home *** CD-ROM | disk | FTP | other *** search
- /*==============================================================================
- Project: POV-Ray
-
- Version: 3
-
- File: FilePrefs.h
-
- Description: File/rendering preferences dialog handling code
- ------------------------------------------------------------------------------
- Author:
- Eduard [esp] Schwan
- ------------------------------------------------------------------------------
- from Persistence of Vision(tm) Ray Tracer
- Copyright 1996 Persistence of Vision Team
- ------------------------------------------------------------------------------
- NOTICE: This source code file is provided so that users may experiment
- with enhancements to POV-Ray and to port the software to platforms other
- than those supported by the POV-Ray Team. There are strict rules under
- which you are permitted to use this file. The rules are in the file
- named POVLEGAL.DOC which should be distributed with this file. If
- POVLEGAL.DOC is not available or for more info please contact the POV-Ray
- Team Coordinator by leaving a message in CompuServe's Graphics Developer's
- Forum. The latest version of POV-Ray may be found there as well.
-
- This program is based on the popular DKB raytracer version 2.12.
- DKBTrace was originally written by David K. Buck.
- DKBTrace Ver 2.0-2.12 were written by David K. Buck & Aaron A. Collins.
- ------------------------------------------------------------------------------
- Change History:
- 941230 [esp] Created
- 950417 [esp] Updates for version 3
- 950629 [esp] Changed fPrf to FPRF per registry with Apple
- 960704 [esp] Changed version to 3.0 final, prepare for release
- ==============================================================================*/
-
- #ifndef FILEPREFS_H
- #define FILEPREFS_H
-
-
- #include "config.h"
-
- #include "Animate.h" // AnimRec_t
-
- /*==== Macintosh-specific headers ====*/
- #include <types.h>
- #include <files.h>
-
-
- /*==== definitions ====*/
-
- // 16 bit unsigned integer, used as simple flags/values in preference files
- typedef unsigned short int UINT16_t;
-
- // the resource ID of the preferences resource (POV-Ray v1.0=128, 2.0=200, 3.0=300)
- #define kFilePrefs_rsrcID 300
- // the resource type
- #define kFilePrefsRsrc 'FPRF'
-
- // The version # of the prefs resources - increment this when prefs_rec_t's change.
- // This currently follows the app version #, so 8352 is version
- // 8 3 5 2
- // (beta) 3.0 release 5 Mac build 2
- // Final release will clear the high nybble (83XX will become 03XX)
-
- #define kFilePrefs_Vers 0x0300
-
-
- /*==== preferences resource - File ====*/
-
- // Progress item values
- enum {
- eProgNone = 0, // quiet
- eProgMac, // Mac info
- eProgVerbose, // Mac & Core info
- eProgDebug, // Mac debug info
- eProgMax = eProgDebug
- };
-
- // Output file values
- enum {
- eOutfNone = 0, // no output file
- eOutfTarga, // uncompressed targa
- eOutfTargaC, // compressed RLE targa
- eOutfPNG, // PNG
- eOutfPPM, // Unix ppm file
- eOutfSystem, // Native system format (PICT) unused since its default
- eOutfMax = eOutfSystem
- };
-
- // Min language version values (+mv)
- enum {
- eMLPOV1 = 1, // POV-Ray 1.0
- eMLPOV2 = 2, // POV-Ray 2.0
- eMLPOV3 = 3, // POV-Ray 3.0
- eMinLangVersion = eMLPOV1,
- eMaxLangVersion = eMLPOV3
- };
-
- #define kMaxOutfileBuffSize 5
-
-
- #define kMinBitsPerColor 5
- #define kMaxBitsPerColor 16
-
-
- // This resource/struct will be saved to disk, and should match
- // its 68K equivalent...
- #if GENERATINGPOWERPC
- #pragma options align=mac68k
- #endif
-
- typedef struct
- {
- UINT16_t prefsVersion; // magic version # of this record (kFilePrefs_rsrcVers)
-
- Rect srcWind_pos; // source window placement on screen
- Rect statWind_pos; // status window placement
- Rect imageWind_pos; // image window placement
- Point LastPrefsDlgPos; // position of prefs mmodal dialog
-
- UINT16_t imageWidth; // width of image in pixels (+W)
- UINT16_t imageHeight; // height of image in pixels (+H)
- Point imageUpperLeft; // image scroll position within window
- Rect selectionArea; // image selection area within window (+SC/+EC/+SR/+ER)
-
- OSType pictFileCreator; // PICT file creator
- OSType targaFileCreator; // Targa file creator
-
- UINT16_t doCreateINI; // Create_Ini=filename
-
- UINT16_t renderQuality; // quality index for image (+Q 0-9)
- UINT16_t radQuality; // radiosity flag (0-1)
- UINT16_t custom_palette; // style of palette to use (-1, 0...4)
- UINT16_t imageMagFactor; // magnification factor of image window (0,1,2,3,4)
-
- UINT16_t outfileType; // output file 0=none, 1=targa, etc
- UINT16_t outfileBuffSize; // Output file buffer size (0,1-4) (+Bn)
- UINT16_t continueTarga; // True to use previous Targa file
- UINT16_t bitsPerColor; // # of bits per color for pixels in image (1,2,4,8,16,32) (Bits_Per_Color=nn)
- UINT16_t doAlphaChannel; // True to add alpha channel output (+UA)
- UINT16_t doDither; // True to dither image
- UINT16_t doPictCompression; // True if compressing image
-
- UINT16_t doBoundSlabs; // True to use bounding slabs (+MB)
- UINT16_t boundSlabThreshold; // Min. # of objects before enabling slabs
-
- UINT16_t progress; // levels of verbose progress during render (1-4) (+V1)
- UINT16_t languageVersion; // for POV-Ray +MV command
-
- UINT16_t previewStart; // 0=none, 1,2,4,8.. = starting grid size (+MPnn)
- UINT16_t previewEnd; // 0=none, 1,2,4,8.. = ending grid size (+EPnn)
-
- UINT16_t doAntialias; // True if antialiasing
- UINT16_t antialiasMethod; // which method, 1 or 2
- float antialiasThreshold; // value of anti-alias threshold
- UINT16_t antialiasDepth; // for POV-Ray +R command
- float antiJitterScale; // for POV-Ray +J command
-
- UINT16_t doSplitUnions; // (+SU)
- UINT16_t doVistaBuffer; // (+UV)
- UINT16_t doLightBuffer; // (+UL)
- UINT16_t doVistaDraw; // (+UD)
- UINT16_t removeBounds; // (+UR)
-
- UINT16_t doHistogram; // Histogram
- UINT16_t histogramType; // Histogram_type
- UINT16_t histogramXSize; // Histogram_Grid_Size
- UINT16_t histogramYSize; // Histogram_Grid_Size
-
- UINT16_t doFieldRender; // Field_Render=on
- UINT16_t doOddField; // Odd_Field=on
-
- UINT16_t doAnimation; // True if doing animation
- AnimRec_t animRec; // animation info record
-
- SCSpatialSettings sc_DialogParams;
- } file_prefs_rec_t, *file_prefs_ptr_t, **file_prefs_hdl_t;
-
- #if GENERATINGPOWERPC
- #pragma options align=reset
- #endif
-
-
- /*==== globals ====*/
- extern file_prefs_hdl_t gFilePrefs_h; // each file has its own prefs
- extern file_prefs_hdl_t gPrefs2Use_h; // points to file or default prefs
-
-
- /*==== prototypes ====*/
- void FilePrefs_Write(short src_wdrefnum, StringPtr src_fname);
- void FilePrefs_Read(short src_wdrefnum, StringPtr src_fname);
- void FilePrefs_Prompt_Init(short src_wdrefnum, StringPtr src_fname);
-
- #endif // FILEPREFS_H